package com.gdssoft.pdaweb.dao.am.impl;

/*
 *  捷达世软件(深圳)有限公司
 *  Copyright (C) 2008-2010 ShenZhen JieDaShi Software Limited Company.
 */

import java.util.ArrayList;
import java.util.List;

import com.gdssoft.core.dao.impl.BaseDaoImpl;
import com.gdssoft.pdaweb.dao.am.AmMonthPlanReadDao;
import com.gdssoft.pdaweb.model.am.AmMonthPlanRead;
import com.gdssoft.pdaweb.model.water.WaterMeterMonthPlanRead;

@SuppressWarnings("unchecked")
public class AmMonthPlanReadDaoImpl extends BaseDaoImpl<AmMonthPlanRead> 
implements AmMonthPlanReadDao {

	public AmMonthPlanReadDaoImpl() {
		super(AmMonthPlanRead.class);
	}

	@Override
	public List<AmMonthPlanRead> listReadByIdMonth(Long planID, String month) {
		String hsql="from AmMonthPlanRead where planID=? and month=?";
		return this.findByHql(hsql, new Object[]{planID,month});
	}
	
	@Override
	public List<AmMonthPlanRead> getPlanTask(String meterId,String month,long planId) {
		String hql = "from AmMonthPlanRead where meterId = '"+meterId+"' and month = '"+month+"' and planID='"+planId+"'";
		List<AmMonthPlanRead> ls = new ArrayList<AmMonthPlanRead>();
		ls = this.findByHql(hql);
		if(ls.size()>0)
		{
		   return ls;
		}
		return new ArrayList<AmMonthPlanRead>(); 
	}
}
